package com.example.demo.controller;

import com.example.demo.service.RedisService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author suliwei
 * @description:
 * @date 2025/3/3 15:49
 */
@RestController
@RequestMapping("redis")
public class RedisController {
    @Resource
    private RedisService redisService;

    @PostMapping("/setRedis")
    public Boolean setRedis(String key, String value) {
        return redisService.set(key, value);
    }

    @PostMapping("/getRedis")
    public String getRedis(String key) {
        return redisService.get(key);
    }
}
